import request from '@/utils/request'

// 查询纸张管理列表
export function listPaper(query) {
  return request({
    url: '/mes/paper/list',
    method: 'get',
    params: query
  })
}

// 查询纸张管理详细
export function getPaper(id) {
  return request({
    url: '/mes/paper/' + id,
    method: 'get'
  })
}

// 新增纸张管理
export function addPaper(data) {
  return request({
    url: '/mes/paper',
    method: 'post',
    data: data
  })
}

// 修改纸张管理
export function updatePaper(data) {
  return request({
    url: '/mes/paper',
    method: 'put',
    data: data
  })
}

// 删除纸张管理
export function delPaper(id) {
  return request({
    url: '/mes/paper/' + id,
    method: 'delete'
  })
}
// 客户信息状态修改
export function changeMesPaperStatus(id, status) {
  const data = {
    id,
    status,
  };
  return request({
    url: "/mes/paper/changeStatus",
    method: "put",
    data: data,
  });
}

// 导出
export const codeExport = (data) => {
  return request({
    url: "mes/paper/export",
    method: "post",
    data,
    responseType: "blob",
  });
};
// 下载模板
export const codeTemplate = (data) => {
  return request({
    url: "mes/paper/importTemplate",
    method: "post",
    data,
    responseType: "blob",
  });
};
